home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / utility / 263 / man / test.man < prev    next >
Encoding:
Text File  |  1988-06-17  |  1.8 KB  |  67 lines

  1.  
  2.  
  3.  
  4.         TEST                  ST-UNIX User's Manual                  TEST
  5.  
  6.  
  7.  
  8.         COMMAND
  9.              test - general condition test
  10.  
  11.         FORMAT
  12.              test expr
  13.  
  14.         DESCRIPTION
  15.              _✓T_✓e_✓s_✓t evaluates the condition _✓e_✓x_✓p_✓r, and if the value is  true
  16.              test  returns  zero exit status, else an exit status of 1 is
  17.              returned.
  18.  
  19.              The following conditions can be used to form an expression.
  20.  
  21.              -r file
  22.                   if the file exists is true.
  23.  
  24.              -f file
  25.                   same as -r.
  26.  
  27.              -w file
  28.                   if the file exists and is writable returns true.
  29.  
  30.              -d file
  31.                   if the file is a directory returns true.
  32.  
  33.              -s file
  34.                   if the file is larger than zero bytes returns true.
  35.  
  36.              -z string
  37.                   if length of string is zero return true.
  38.  
  39.              -n s1
  40.                   is length of string is non zero is true.
  41.  
  42.              sstring1 = string2
  43.                   if both string are equal returns true.
  44.  
  45.              string1 != string2
  46.                   if both strings are not equal returns true.
  47.  
  48.              string
  49.                   is string is not null returns true.  So  test  with  no
  50.                   arguments return false.
  51.  
  52.              number1 -eq number2
  53.                   if numbers are equal is true.  Other  comparisons  are:
  54.                   -gt, -ge, -lt, -le, and -ne.
  55.  
  56.              The operators may be combined with: ! (negation), -a  (logi-
  57.              cal  and),  and  -o (logical or). Expressions may be grouped
  58.              with parenthesis.
  59.  
  60.  
  61.  
  62.  
  63.         Printed 10/April/1987     1 April 1987                          1
  64.  
  65.  
  66.  
  67.